# $Id$
# Maintainer: Eduardo Romero <eduardo@archlinux.org>
pkgname=wine
pkgver=1.1.32
pkgrel=1
pkgdesc="A compatibility layer for running Windows programs"
url="http://www.winehq.com"
arch=('i686')
license=('LGPL')
depends=('fontconfig' 'libldap' 'libxslt' 'lcms' 'libxxf86dga' \
         'libxcursor' 'libxrandr' 'libxdamage' 'mesa')
makedepends=('cups' 'sane' 'fontforge' 'flex' 'bison' 'libgphoto2' 
             'libxinerama' 'giflib' 'ncurses' 'libxcomposite' 'samba' \
             'libxpm' 'libxmu' 'libxxf86vm' 'perl' 'libxml2' 'alsa-lib')
optdepends=("cups" "sane" "libgphoto2" "alsa-lib" "giflib" "libjpeg" "libpng")
#source=(http://downloads.sourceforge.net/wine/wine-$pkgver.tar.bz2)
options=('emptydirs')
md5sums=('')

apatch(){
  for i in ${startdir}/{wine_ch+aa,saves,secur32-Disable-schannel-InitializeSecurityContextW,keyrepeat-fix}.patch
  do 
      msg2 "adding `basename $i`"
      patch -Np1 -i $i || return 1
  done
  
  for n in ${startdir}/{completion_disable,EventC}.diff
  do 
      msg2 "adding `basename $i`"
      patch -Np1 -i $i || return 1
  done
  msg2 "replace iexplore with host broswer.."
  cp ${startdir}/iexplore.c ${srcdir}/$pkgname-$pkgver/programs/iexplore || return 1
}

build() {
  cd $srcdir/$pkgname-$pkgver

  #apatch || return 1

  #./configure --prefix=/usr --sysconfdir=/etc --with-x
  #make depend || return 1
  make || return 1
  make prefix=$pkgdir/usr install || return 1
  mkdir -p $pkgdir/etc/wine
}
